/*++
"This software program is available to you under a choice of one of two 
licenses.  You may choose to be licensed under either the GNU General Public 
License (GPL) Version 2, June 1991, available at 
http://www.fsf.org/copyleft/gpl.html, or the BSD License, the text of
which follows:

Copyright (c) 1996-2005, Intel Corporation. All rights reserved.

Redistribution and use in source and binary forms, with or without 
modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this 
list of conditions and the following disclaimer. 

Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or 
other materials provided with the distribution. 

Neither the name of the Intel Corporation ("Intel") nor the names of its 
contributors may be used to endorse or promote products derived from this
software without specific prior written permission. 

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
--*/

#ifndef __XLLP_PM_MICCO_B0_H
#define __XLLP_PM_MICCO_B0_H

#include "xllp_defs.h"
#include "xllp_i2c.h"
#include "xllp_ost.h"
#include "micco.h"

/*SYSTEM & EVENT */
#define XLLP_MICCO_CHIP_ID				0x00
#define XLLP_MICCO_EVENT_A				0x01
#define XLLP_MICCO_EVENT_B				0x02
#define XLLP_MICCO_EVENT_C				0x03
#define XLLP_MICCO_EVENT_D				0x04
#define XLLP_MICCO_EVENT_COUNT			0x04


#define XLLP_MICCO_STATUS_A				0x05
#define XLLP_MICCO_STATUS_B				0x06

#define XLLP_MICCO_SYS_CTRL_A				0x0b
#define XLLP_MICCO_SYS_CTRL_B				0x0c
#define XLLP_MICCO_FAULT_LOG				0x0D

/*POWER*/
#define XLLP_MICCO_OVER_1				0x10
#define XLLP_MICCO_OVER_2				0x11
#define XLLP_MICCO_OVER_3				0x12
#define XLLP_MICCO_LDO64321			0x13
#define XLLP_MICCO_LDO987				0x14
#define XLLP_MICCO_LDO1110				0x15
#define XLLP_MICCO_LDO1312				0x16
#define XLLP_MICCO_LDO1514				0x17
#define XLLP_MICCO_BUCK_SLEEP			0x18

/*BUCK DVC*/
#define XLLP_MICCO_VCC1					0x20
#define XLLP_MICCO_VCC1_SRAM_GO		XLLP_BIT_4
#define XLLP_MICCO_VCC1_SRAM_SEL		XLLP_BIT_5
#define XLLP_MICCO_VCC1_APPS_GO		XLLP_BIT_0
#define XLLP_MICCO_VCC1_APPS_SEL		XLLP_BIT_1

#define XLLP_MICCO_ADTV1				0x23
#define XLLP_MICCO_ADTV2				0x24
#define XLLP_MICCO_AVRC				0x25
#define XLLP_MICCO_CDTV1				0x26
#define XLLP_MICCO_CDTV2				0x27
#define XLLP_MICCO_CVRC					0x28
#define XLLP_MICCO_SDTV1				0x29
#define XLLP_MICCO_SDTV2				0x2A

/*MISCELLANEOUS*/

#define XLLP_MICCO_MISC				0x41

/*GPADC & TSI
#define XLLP_MICCO_MANUAL					0x40
#define XLLP_MICCO_AUTO					0x41
#define XLLP_MICCO_AUTO_2					0x42
#define XLLP_MICCO_TSI_1					0x43
#define XLLP_MICCO_TSI_2					0x44
#define XLLP_MICCO_VBATMON				0x45
#define XLLP_MICCO_TBATHIGHP				0x46
#define XLLP_MICCO_TBATHIGHN				0x47
#define XLLP_MICCO_TBATLOW				0x48
#define XLLP_MICCO_AUTO4HIGH				0x49
#define XLLP_MICCO_AUTO4LOW				0x4a
#define XLLP_MICCO_AUTO5HIGH				0x4b
#define XLLP_MICCO_AUTO5LOW				0x4c
#define XLLP_MICCO_AUTO6HIGH				0x4d
#define XLLP_MICCO_AUTO6LOW				0x4e
#define XLLP_MICCO_MAN_RES_LSB			0x4f
#define XLLP_MICCO_MAN_RES_MSB			0x50
#define XLLP_MICCO_VBAT_RES				0x51
#define XLLP_MICCO_VBATMIN_RES			0x52
#define XLLP_MICCO_ICHMAX_RES				0x53
#define XLLP_MICCO_ICHMIN_RES				0x54
#define XLLP_MICCO_ICHAVERAGE_RES			0x55
#define XLLP_MICCO_VCHMAX_RES				0x56
#define XLLP_MICCO_VCHMIN_RES				0x57
#define XLLP_MICCO_TBAT_RES				0x58
#define XLLP_MICCO_AUTO4_RES				0x59
#define XLLP_MICCO_AUTO5_RES				0x5a
#define XLLP_MICCO_AUTO6_RES				0x5b
#define XLLP_MICCO_TSI_X_MSB				0x5c
#define XLLP_MICCO_TSI_Y_MSB				0x5d
#define XLLP_MICCO_TSI_X_Y_LSB				0x5e

/*AUDIO*/
/*
#define XLLP_MICCO_RX_AUDIO_MUX1			0x60
#define XLLP_MICCO_RX_AUDIO_MUX2			0x61
#define XLLP_MICCO_RX_AUDIO_MUX3			0x62
#define XLLP_MICCO_AUDIO_LINE_AMP			0x63
#define XLLP_MICCO_STEREO_AMPLITUDE_CH1	0x64
#define XLLP_MICCO_STEREO_AMPLITUDE_CH2	0x65
#define XLLP_MICCO_STEREO_DAC_CONTROL	0x66
#define XLLP_MICCO_MONO_VOL				0x67
#define XLLP_MICCO_BEAR_VOL				0x68
#define XLLP_MICCO_I2S_CONTROL				0x69
#define XLLP_MICCO_TX_PGA					0x6a
#define XLLP_MICCO_MICAMP					0x6b
#define XLLP_MICCO_TX_PGA_MUX				0x6c
#define XLLP_MICCO_VOICE_CODEC_ADC		0x6d
#define XLLP_MICCO_VOICE_CODEC_DAC		0x6e
#define XLLP_MICCO_SIDE_TONE				0x6f
#define XLLP_MICCO_PGA_AUX_1_2			0x70
#define XLLP_MICCO_PGA_AUX_3				0x71

*/
#define XLLP_SYS_CTRL_A_WDT_ENABLE		XLLP_BIT_2
#define XLLP_SYS_CTRL_A_RESET			0
#ifdef __cplusplus
extern "C"
{
#endif

extern XLLP_STATUS_T XllpPmMiccoInit(XLLP_I2C_T *, XLLP_OST_T *);

extern XLLP_STATUS_T XllpPmMiccoWrite(XLLP_I2C_T *, XLLP_OST_T *, XLLP_UINT8_T , XLLP_UINT8_T );

extern XLLP_STATUS_T XllpPmMiccoRead(XLLP_I2C_T *, XLLP_OST_T *, XLLP_UINT8_T , XLLP_UINT8_T *);

extern XLLP_STATUS_T XllpPmMiccoSetVccSram(XLLP_I2C_T *, XLLP_OST_T *, XLLP_UINT32_T );

extern XLLP_STATUS_T XllpPmMiccoSetVccCore(XLLP_I2C_T *, XLLP_OST_T *, XLLP_UINT32_T );

extern XLLP_STATUS_T XllpPmMiccoGetVccSram(XLLP_I2C_T *, XLLP_OST_T *, XLLP_UINT32_T *);

extern XLLP_STATUS_T XllpPmMiccoGetVccCore(XLLP_I2C_T *, XLLP_OST_T *, XLLP_UINT32_T *);

extern XLLP_STATUS_T XllpPmMiccoShutDown(XLLP_I2C_T *i2cRegs, XLLP_OST_T *ostRegs);

#ifdef __cplusplus
}
#endif

#endif

